package com.eron.customviewdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.eron.customviewdemo.view.GiftView;

public class MainActivity extends AppCompatActivity {

    private GiftView giftView;
    private Button button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_main);
        setContentView(R.layout.activity_main2);

        giftView = findViewById(R.id.gift_view);
        button = findViewById(R.id.button);

        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                giftView.addImageView();
            }
        });

        button.setOnClickListener(v -> giftView.addImageView());
    }
}